package com.lma.crm.staff.dao.impl;

import java.util.List;

import com.lma.crm.base.impl.BaseDaoImpl;
import com.lma.crm.staff.dao.CrmStaffDao;
import com.lma.crm.staff.domain.CrmStaff;

public class CrmStaffDaoImpl extends BaseDaoImpl<CrmStaff> implements CrmStaffDao {

	@SuppressWarnings("unchecked")
	@Override
	public CrmStaff find(String loginName, String loginPwd) {
		List<CrmStaff> staffList = this.getHibernateTemplate().find("from CrmStaff where loginName = ? and loginPwd = ?",
				loginName, loginPwd);
		if(staffList.size() == 1) {
			return staffList.get(0);
		}
		return null;
	}

}
